package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

@TableName("t_shop")
public class ShopBean {
    @TableId(value = "pk_shopId",type = IdType.AUTO)
    private  Integer id;//购物车编号
    @TableField("s_num")
    private  Integer num=1;//商品数量
    @TableField("fk_userId")
    private  Integer userId;//用户编号
    @TableField("fk_productId")
    private  Integer productId;//商品编号
    @TableField(exist = false)
    private  ProductBean product;//商品对象

    @Override
    public String toString() {
        return "ShopBean{" +
                "id=" + id +
                ", num=" + num +
                ", userId=" + userId +
                ", productId=" + productId +
                ", product=" + product +
                "}\n";
    }

    public ShopBean( Integer userId, Integer productId) {
        this.userId = userId;
        this.productId = productId;

    }

    public ShopBean() {
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getProductId() {
        return productId;
    }

    public void setProductId(Integer productId) {
        this.productId = productId;
    }

    public ProductBean getProduct() {
        return product;
    }

    public void setProduct(ProductBean product) {
        this.product = product;
    }
}
